package cn.pconline.autoclub.util.ubb.node;

import java.util.LinkedList;

import cn.pconline.autoclub.util.ubb.Node;

/**
 *
 * @author xhchen
 */
public abstract class AbstractNode implements Node {
	String name;
	String attribute;
	StringBuilder text = new StringBuilder();
    StringBuilder imgText = new StringBuilder();//专门存放imgNode的内容，为了审核的图文分开
    long postId;
    int sequence;
    int floor;
    boolean thumbNailFlag; //是否需要显示缩略图

	@Override
	public String getName() {
		return name;
	}

	@Override
	public String getAttribute() {
		return attribute;
	}

	@Override
	public void appendNode(Node node, java.util.LinkedList<Node> stack) {
        text.append(node.getText(stack));
	}

    @Override
	public void appendImgNode(Node node, java.util.LinkedList<Node> stack) {
        imgText.append(node.getImgText(stack));
	}

	@Override
	public StringBuilder getText() {
		return getText(null);
	}

    @Override
    public StringBuilder getImgText(LinkedList<Node> stack) {
        return imgText;
    }

    @Override
    public StringBuilder getImgText() {
        return getImgText(null);
    }
    
    public void setPostId(long postId){
        this.postId = postId;
    }
    
    public long getPostId(){
        return postId;
    }
    
    public void setSequence(int seq){
        this.sequence = seq;
    }
    
    public int getSequence(){
        return this.sequence;
    }

    public void setFloor(int floor) {
        this.floor = floor;
    }

    public int getFloor() {
        return floor;
    }

    public void setThumbNailFlag(boolean thumbNailFlag) {
        this.thumbNailFlag = thumbNailFlag;
    }
}
